package com.example.boot.filter;

import com.example.boot.config.PathConfig;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.context.annotation.Configuration;
import org.springframework.web.servlet.config.annotation.InterceptorRegistration;
import org.springframework.web.servlet.config.annotation.InterceptorRegistry;
import org.springframework.web.servlet.config.annotation.WebMvcConfigurer;


@Configuration
public class LoginAdapter implements WebMvcConfigurer {

    @Autowired
    private PathConfig pathConfig;
    
    @Override
    public void addInterceptors(InterceptorRegistry registry) {

        InterceptorRegistration ir = registry.addInterceptor(new LoginInterceptor());
        ir.excludePathPatterns(pathConfig.getExclude());// 配置不拦截
    }

}
